import request from '@/api/request'

/**
 * 获取订单列表
 * @param {*} start 页码
 * @param {*} limit 每页数量
 * @returns 返回列表
 */
export function findOrdersByPage(start, limit, data) {
  return request({
    url: `/lejuAdmin/order/findOrdersByPage/${start}/${limit}`,
    method: 'post',
    data
  })
}

/**
 * 关闭订单
 * @param {*} id 此订单id
 * @returns 返回结果
 */
export function finishOrder(id) {
  return request({
    url: `/lejuAdmin/order/finishOrder/${id}`,
    method: 'post'
  })
}

/**
 * 查看订单明细
 * @param {*} id  此订单orderId
 * @returns
 */
export function orderDetail(id) {
  return request({
    url: `/lejuAdmin/order/orderDetail/${id}`,
    method: 'get'
  })
}

/**
 * 强制确认收货
 * @param {*} id 此订单orderId
 * @returns
 */
export function receiveProductsForce(id) {
  return request({
    url: `/lejuAdmin/order/receiveProductsForce//${id}`,
    method: 'post'
  })
}

/**
 * 确认发货
 * @param {*} data
 * @param {*} orderId 订单orderId
 * @param {*} deliverySn 订单物流单号
 * @param {*} deliveryCompany  此订单的物流公司名称
 * @returns 返回结果
 */
export function sendDone(data) {
  return request({
    url: '/lejuAdmin/order/sendDone',
    method: 'post',
    data
  })
}

// export {
//   findOrdersByPage,
//   finishOrder,
//   orderDetail,
//   receiveProductsForce,
//   sendDone
// }
